/**
 * 
 */
package com.cqan.tuan.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cqan.entity.pk.LongEntity;

/**
 *  团购网站
 * 
 * @author slaton
 * 
 * 2012-11-30下午10:19:55 created
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "TBL_TUAN_WEBSITE")
//默认的缓存策略.
@SuppressWarnings("serial")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class TuanWebsite extends LongEntity {
	//API地址
	private String apiUrl;
	//添加日期
	private Date ctime;
	//网站名称
	private String name;
	//状态
	private  Boolean state;
	//模板
	private WebSiteTemplate webSiteTemplate;

	public String getApiUrl() {
		return apiUrl;
	}

	public Date getCtime() {
		return ctime;
	}

	public String getName() {
		return name;
	}

	public Boolean getState() {
		return state;
	}

	 @ManyToOne(optional = true)  
	 @JoinColumn(name="template_id")//这里设置JoinColum设置了外键的名字
	public WebSiteTemplate getWebSiteTemplate() {
		return webSiteTemplate;
	}

	public void setApiUrl(String apiUrl) {
		this.apiUrl = apiUrl;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setState(Boolean state) {
		this.state = state;
	}

	public void setWebSiteTemplate(WebSiteTemplate webSiteTemplate) {
		this.webSiteTemplate = webSiteTemplate;
	}
	
	
}
